package com.liws.hellopoi.controller;

import com.liws.hellopoi.commons.ResponseVo;
import com.liws.hellopoi.service.PoiReadExcelService;
import org.apache.poi.poifs.filesystem.POIFSFileSystem;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;
import java.util.List;

/**
 * @Author: liweisheng
 * @Dcscription: poi操作excel(读取)
 * @Date: 2022/1/27 14:59
 */
@RestController
@RequestMapping("/")
public class UploadExcelPoiRead {

    @Autowired
    PoiReadExcelService poiReadExcelService;
    @RequestMapping(value = "/upload",method = RequestMethod.POST)
    public ResponseVo uploadExcel(@RequestParam("file") MultipartFile file) throws IOException {

        return poiReadExcelService.poiReadExcel(file);
    }
}
